home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / reuse.lha / reuse / m2c / SysIODrv.c < prev    next >
C/C++ Source or Header  |  1992-08-18  |  631b  |  34 lines

  1. #include "SYSTEM_.h"
  2.  
  3. #ifndef DEFINITION_System
  4. #include "System.h"
  5. #endif
  6.  
  7. #ifndef DEFINITION_Checks
  8. #include "Checks.h"
  9. #endif
  10.  
  11. static struct S_1 {
  12.     CHAR A[1023 + 1];
  13. } b;
  14. static System_tFile f;
  15. static INTEGER n;
  16.  
  17.  
  18. void BEGIN_MODULE()
  19. {
  20.   BEGIN_System();
  21.   BEGIN_Checks();
  22.  
  23.   f = OpenInput((STRING)"Makefile", 8L);
  24.   Checks_ErrorCheck((STRING)"OpenInput", 9L, f);
  25.   n = Read(f, ADR(b), 1024L);
  26.   Checks_ErrorCheck((STRING)"Read", 4L, n);
  27.   Close(f);
  28.   f = OpenOutput((STRING)"t", 1L);
  29.   Checks_ErrorCheck((STRING)"OpenOutput", 10L, f);
  30.   n = Write(f, ADR(b), 1024L);
  31.   Checks_ErrorCheck((STRING)"Write", 5L, n);
  32.   Close(f);
  33. }
  34.